package com.ruoyi.project.sysmanage.service.impl;

import com.ruoyi.project.sysmanage.domain.User;
import com.ruoyi.project.sysmanage.mapper.SysmConsumerMapper;
import com.ruoyi.project.sysmanage.service.SysmConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;
@Service
public class SysmConsumerServiceImpl implements SysmConsumerService {

    @Autowired
    private SysmConsumerMapper sysmConsumerMapper;

    @Override
    public List<User> findAll(User user) {

        List<User> list=sysmConsumerMapper.selectAll(user);

        return list;
    }

    @Override
    public int insertOne(User user) {

        user.setCreateTime(new Date());
        return sysmConsumerMapper.insert(user);
    }

    @Override
    public List<User> getAll() {
        return sysmConsumerMapper.select();
    }

    @Override
    public User getById(int userId) {


        return sysmConsumerMapper.selectOne(userId);
    }

    @Override
    public int updateUser(User user) {

        return sysmConsumerMapper.updateOne(user);
    }

    @Override
    public int deleteDepts(int[] delUsers) {
        return sysmConsumerMapper.deleteUsers(delUsers);
    }
}
